Skip to content

feat: Register child devices as top level devices - #1739

Open
Alexj9837 wants to merge 11 commits into
mainfrom
register-child-devices-on-top
Open

Alexj9837 wants to merge 11 commits into
mainfrom
register-child-devices-on-top

Conversation

@Alexj9837

@Alexj9837 Alexj9837 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1724

Registering an ophyd-async device now also registers its children, including signals, under their own names at any depth (stage also gives stage-x, stage-x-velocity etc). Dotted access still works. Ophyd v1 devices are left alone.

Name clashes:

  • The first device registered under a name keeps it. Any later device with the same name, top level or child, is not registered and neither are its children. The first clash logs a single warning, and each clash is logged at debug
  • This includes a motor's user_readback, which ophyd-async gives the motor's name. It's still reachable as motor.user_readback
  • Top level devices used to replace an existing device with the same name, now the first one is kept
  • /devices reports each device under its registered name, so a motor registered with an override name doesn't appear twice alongside its readback

Things to note:

  • /devices and the plan schemas get a lot bigger (adsim goes from 2 to 117 devices), and low level signals like setpoints now show up as plan argument options.

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.48%. Comparing base (4353ae2) to head (8c58734).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1739      +/-   ##
==========================================
+ Coverage   96.46%   96.48%   +0.01%     
==========================================
  Files          49       49              
  Lines        3791     3810      +19     
==========================================
+ Hits         3657     3676      +19     
  Misses        134      134              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Alexj9837
Alexj9837 force-pushed the register-child-devices-on-top branch from b4975f8 to e7797e3 Compare November 3, 2026 08:35
@Alexj9837
Alexj9837 force-pushed the register-child-devices-on-top branch from e7797e3 to 396a673 Compare November 3, 2026 08:36
@Alexj9837
Alexj9837 force-pushed the register-child-devices-on-top branch from 9fd0086 to 8ee7db7 Compare November 3, 2026 09:10
@Alexj9837
Alexj9837 marked this pull request as ready for review November 3, 2026 15:12
@Alexj9837
Alexj9837 requested a review from a team as a code owner November 3, 2026 15:12
@Alexj9837 Alexj9837 assigned Alexj9837 and unassigned Alexj9837 Nov 3, 2026

@tpoliaw tpoliaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks ok, I'm mainly unsure of the required behaviour around handling duplicates.

Comment thread src/blueapi/core/context.py Resolved
Comment thread src/blueapi/core/context.py Resolved
Comment thread src/blueapi/core/context.py Resolved
Comment thread tests/unit_tests/core/test_context.py Resolved
Comment thread tests/unit_tests/core/test_context.py Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register child devices as top level devices

2 participants